import Taro, { Component } from '@tarojs/taro'
import { View, Button, Text } from '@tarojs/components'
import { observer, inject } from '@tarojs/mobx'
import {
  EcIcon,
  Tag
} from '../../components'
import './index.styl'


@inject('counterStore')
@observer
class Index extends Component {

  // eslint-disable-next-line react/sort-comp
  config = {
    navigationBarTitleText: '首页'
  }

  componentWillMount () { }

  componentWillReact () {
    console.log('componentWillReact')
  }

  componentDidMount () { }

  componentWillUnmount () { }

  componentDidShow () { }

  componentDidHide () { }

  increment = () => {
    const { counterStore } = this.props
    counterStore.increment()
  }

  decrement = () => {
    const { counterStore } = this.props
    counterStore.decrement()
  }

  incrementAsync = () => {
    const { counterStore } = this.props
    counterStore.incrementAsync()
  }

  render () {
    const bgcolor = '#F60'
    const isLighting = true
    const { counterStore: { counter } } = this.props
    return (
      <View className='index FBV p30 scrollbar'>
        <View className='FBH'>
          <EcIcon
            name='icon-xingxing1'
            color={['red', 'green']}
            isLighting={isLighting}
            fontSize='50px'
          />
          <EcIcon />
        </View>
        <View className='FBH'>
          <Tag>爆款</Tag>
        </View>

      </View>
    )
  }
}

export default Index
